{extend name='common@layout/seller' /}
{block name="left"}{include file='store/left'}{/block}
{block name="breadcrumb"}
<div class="ncsc-path"><i class="icon-desktop"></i>商家管理中心<i class="icon-angle-right"></i>店铺<i class="icon-angle-right"></i>店铺分类</div>
{/block}
{block name='content'}
<div class="tabmenu">
    <ul class="tab pngFix">
        <li class="active"><a  href="/index.php?s=seller/store/store_goods_class">店铺分类</a></li>
    </ul>
    <a href="javascript:void(0)" class="ncsc-btn ncsc-btn-green" nc_type="dialog" dialog_title="新增分类" dialog_id="my_category_add" dialog_width="480" uri="/index.php?s=seller/store/store_goods_class&type=ok" title="新增分类">新增分类</a>
</div>

<table class="ncsc-default-table" id="my_category" server="index.php?act=store_goods_class&op=goods_class_ajax" >
  <thead>
    <tr nc_type="table_header">
      <th class="w30"></th>
      <th coltype="editable" column="stc_name" checker="check_required" inputwidth="50%">分类名称</th>
      <th class="w60" coltype="editable" column="stc_sort" checker="check_max" inputwidth="30px">排序</th>
      <th class="w120" coltype="switchable" column="stc_state" checker="" onclass="showclass-ico-btn" offclass="noshowclass-ico-btn">显示</th>
      <th class="w100">操作</th>
    </tr>
    {if (!empty($class_info))}
    <tr>
      <td class="tc"><input id="all" type="checkbox" class="checkall" /></td>
      <td colspan="20"><label for="all">全选</label>
        <a href="javascript:void(0)" class="ncsc-btn-mini" nc_type="batchbutton" uri="/index.php?s=seller/store/goods_class_del" name="class_id" confirm="确认删除吗?"><i class="icon-trash"></i>删除</a></td>
    </tr>
    {/if}
      </thead>
  <tbody id="treet1">
    {if (!empty($class_info))}
    {volist name="class_info" id="val"}
    <tr class="bd-line" nc_type="table_item" idvalue="{$val.id}" >
      <td class="tc"><input type="checkbox" class="checkitem" value="{$val.id}" /></td>
      <td class="tl"><span class="ml5" nc_type="editobj" >{$val.name}</span>
      {if condition="$val.parent_id eq 0"}
        <span class="add_ico_a"> <a href="javascript:void(0)" class="ncsc-btn" nc_type="dialog" dialog_width="480" dialog_title="新增下级" dialog_id="my_category_add" uri="/index.php?s=seller/store/store_goods_class&top_class_id={$val.id}&type=ok" >新增下级</a></span>
        {/if}
        </td>
      <td><span nc_type="editobj">{$val.sort}</span></td>
      <td>{if condition="$val.state eq 1"}
        		是
        {else /}
        		否
        {/if}</td>
      <td class="nscs-table-handle"><span><a href="javascript:void(0)" nc_type="dialog" dialog_width="480" dialog_title="编辑" dialog_id="my_category_edit" uri="/index.php?s=seller/store/store_goods_class&class_id={$val.id}&type=ok" class="btn-blue"><i class="icon-edit"></i>
        <p>编辑</p>
        </a></span> <span><a href="javascript:void(0)" onclick="ajax_get_confirm('确认删除?', '/index.php?s=seller/store/goods_class_del&class_id={$val.id}');" class="btn-red"><i class="icon-trash"></i>
        <p>删除</p>
        </a></span></td>
    </tr>
    {/volist}
    {else /}
    <tr>
      <td colspan="20" class="norecord"><div class="warning-option"><i class="icon-warning-sign"></i><span>暂无符合条件的数据记录</span> </div></td>
    </tr>
    {/if}
      </tbody>
      {if (!empty($class_info))}
  <tfoot>
    <tr>
      <th class="tc"><input id="all2" type="checkbox" class="checkall" /></th>
      <th colspan="15"><label for="all2">全选</label>
        <a href="javascript:void(0)" class="ncsc-btn-mini" nc_type="batchbutton" uri="/seller/store/goods_class_del" name="class_id" confirm="确认删除吗?"><i class="icon-trash"></i>删除</a></th>
    </tr>
  </tfoot>
  {/if}
  </table>
<style>
.collapsed{display:none;}
</style>
<script src="/old/data/resource/js/jqtreetable.js"></script>
<script>
$(function()
{
    var map = [{$map}];
    var path = "/old/shop/templates/new20160622/images/";
    if (map.length > 0)
    {
        var option = {
		openImg: path + "treetable/tv-collapsable.gif",
		shutImg: path + "treetable/tv-expandable.gif",
		leafImg: path + "treetable/tv-item.gif",
		lastOpenImg: path + "treetable/tv-collapsable-last.gif",
		lastShutImg: path + "treetable/tv-expandable-last.gif",
		lastLeafImg: path + "treetable/tv-item-last.gif",
		vertLineImg: path + "treetable/vertline.gif",
		blankImg: path + "treetable/blank.gif",
		collapse: false,
		column: 1,
		striped: false,
		highlight: false,
		state:false};
        $("#treet1").jqTreeTable(map, option);
    }
});
</script>
{/block}